// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file sensor_selection.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "sensor_selection.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

sensor_selection::sensor_selection()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_accel_device_id_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_accel_device_id_ = 0;
    // m_gyro_device_id_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_gyro_device_id_ = 0;
    // m_mag_device_id_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_mag_device_id_ = 0;

}

sensor_selection::~sensor_selection()
{




}

sensor_selection::sensor_selection(const sensor_selection &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_accel_device_id_ = x.m_accel_device_id_;
    m_gyro_device_id_ = x.m_gyro_device_id_;
    m_mag_device_id_ = x.m_mag_device_id_;
}

sensor_selection::sensor_selection(sensor_selection &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_accel_device_id_ = x.m_accel_device_id_;
    m_gyro_device_id_ = x.m_gyro_device_id_;
    m_mag_device_id_ = x.m_mag_device_id_;
}

sensor_selection& sensor_selection::operator=(const sensor_selection &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_accel_device_id_ = x.m_accel_device_id_;
    m_gyro_device_id_ = x.m_gyro_device_id_;
    m_mag_device_id_ = x.m_mag_device_id_;

    return *this;
}

sensor_selection& sensor_selection::operator=(sensor_selection &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_accel_device_id_ = x.m_accel_device_id_;
    m_gyro_device_id_ = x.m_gyro_device_id_;
    m_mag_device_id_ = x.m_mag_device_id_;

    return *this;
}

size_t sensor_selection::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

size_t sensor_selection::getCdrSerializedSize(const sensor_selection& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

void sensor_selection::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_accel_device_id_;
    scdr << m_gyro_device_id_;
    scdr << m_mag_device_id_;
}

void sensor_selection::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_accel_device_id_;
    dcdr >> m_gyro_device_id_;
    dcdr >> m_mag_device_id_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void sensor_selection::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t sensor_selection::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& sensor_selection::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member accel_device_id_
 * @param _accel_device_id_ New value for member accel_device_id_
 */
void sensor_selection::accel_device_id_(uint32_t _accel_device_id_)
{
m_accel_device_id_ = _accel_device_id_;
}

/*!
 * @brief This function returns the value of member accel_device_id_
 * @return Value of member accel_device_id_
 */
uint32_t sensor_selection::accel_device_id_() const
{
    return m_accel_device_id_;
}

/*!
 * @brief This function returns a reference to member accel_device_id_
 * @return Reference to member accel_device_id_
 */
uint32_t& sensor_selection::accel_device_id_()
{
    return m_accel_device_id_;
}

/*!
 * @brief This function sets a value in member gyro_device_id_
 * @param _gyro_device_id_ New value for member gyro_device_id_
 */
void sensor_selection::gyro_device_id_(uint32_t _gyro_device_id_)
{
m_gyro_device_id_ = _gyro_device_id_;
}

/*!
 * @brief This function returns the value of member gyro_device_id_
 * @return Value of member gyro_device_id_
 */
uint32_t sensor_selection::gyro_device_id_() const
{
    return m_gyro_device_id_;
}

/*!
 * @brief This function returns a reference to member gyro_device_id_
 * @return Reference to member gyro_device_id_
 */
uint32_t& sensor_selection::gyro_device_id_()
{
    return m_gyro_device_id_;
}

/*!
 * @brief This function sets a value in member mag_device_id_
 * @param _mag_device_id_ New value for member mag_device_id_
 */
void sensor_selection::mag_device_id_(uint32_t _mag_device_id_)
{
m_mag_device_id_ = _mag_device_id_;
}

/*!
 * @brief This function returns the value of member mag_device_id_
 * @return Value of member mag_device_id_
 */
uint32_t sensor_selection::mag_device_id_() const
{
    return m_mag_device_id_;
}

/*!
 * @brief This function returns a reference to member mag_device_id_
 * @return Reference to member mag_device_id_
 */
uint32_t& sensor_selection::mag_device_id_()
{
    return m_mag_device_id_;
}


size_t sensor_selection::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;







    return current_align;
}

bool sensor_selection::isKeyDefined()
{
   return false;
}

void sensor_selection::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
}
